define(function (require, exports, module) {
    var _config = require("../nuui/nuui-config");
    //root:'http://test1.hulubank.com.cn/api/cm',
    var server = module.exports = function() {
        var root = '';
        if (_config.CONFIG_NODEJS_SERVER) {
            root = '';
        }else {
      //    测试服务器配置
            var href = window.location.href.split("/");
            root = href[0]+"//"+href[1]+href[2]+"/";
            //  root = href[0]+"//"+href[1]+href[2]+"/jgpt/";
            root = 'http://192.168.11.63:8092/gcloud-app/';
        }

        this.path = {
            root: root,
            getSessionId:"userLoginAction",                                     //获得session
            smartGroupAction:"smartGroup/smartGroup",                           //获取智囊团信息
            myFocusAction:"count/myFocus",                                      //获取我的关注信息
            myOrderAction:"count/myOrder",                                      //获取我的订单信息
            vouchercenterAction:"count/vouchercenter",                          //获取充值中心信息
            collectAllAction:"mycollect/collectAll",                            //获取我的收藏信息
            baokuanAction:"product/baokuan",                                    //获取爆款信息
            caiyundingzhiAction:"product/caiyundingzhi",                        //获取彩云定制信息
            cloudlectureAction:"product/cloudlecture",                          //获取云讲座信息
            cloudprocurementAction:"product/cloudprocurement",                  //获取云采购信息
            cloudprojectAction:"product/cloudproject",                          //获取云项目信息
            communicationIndustryAction:"product/communicationIndustry",        //获取通讯行业信息
            communicationServicesAction:"product/communicationServices",        //获取通讯服务信息
            enterpriseAction:"product/enterprise",                              //获取云品牌信息
            internetAction:"product/internet",                                  //获取因特网信息
            internetOfThingsAction:"product/internetOfThings",                  //获取物特网信息
            productAction:"product/product",                                    //获取全部产品信息
            securityServicesAction:"product/securityServices"                   //获取安全服务信息
        };

        this.NodePath = {
            root: root + 'mock/',
            "userLoginAction":"true",                  //获得session
            "smartGroup/smartGroup":"true",            //获取智囊团信息
            "count/myFocus":"true",                    //获取我的关注信息
            "count/myOrder":"true",                    //获取我的订单信息
            "count/vouchercenter":"true",              //获取充值中心信息
            "mycollect/collectAll":"true",                //获取我的收藏信息
            "product/baokuan":"true",                  //获取爆款信息
            "product/caiyundingzhi":"true",            //获取彩云定制信息
            "product/cloudlecture":"true",             //获取云讲座信息
            "product/cloudprocurement":"true",         //获取云采购信息
            "product/cloudproject":"true",             //获取云项目信息
            "product/communicationIndustry":"true",    //获取通讯行业信息
            "product/communicationServices":"true",    //获取通讯服务信息
            "product/enterprise":"true",               //获取云品牌信息
            "product/internet":"true",                 //获取因特网信息
            "product/internetOfThings":"true",         //获取物特网信息
            "product/product":"true",                  //获取全部产品信息
            "product/securityServices":"true"          //获取安全服务信息
        };

        if (_config.CONFIG_MOCK_SERVER) {
            this.path = Mock;
        }

        this.getServePath = function (path) {
         /*   console.log(this.NodePath[path]);
            console.log(_config.CONFIG_NODEJS_SERVER);*/
            if(this.NodePath[path] && _config.CONFIG_NODEJS_SERVER ){
                return getMoockPath(path);

            }
            return this.path.root + path + '.do';
        };

        function getMoockPath(path){

            var paths;
                paths= root + '/mock/' + path + '.json';
                /*console.log(paths)*/
            return paths;

        }
    }
});